package com.rose.doorto.footbathdoor.controler;


import com.rose.doorto.footbathdoor.pojo.DgtxPlaces;
import com.rose.doorto.footbathdoor.service.impl.DgtxPlacesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lqc
 * @since 2024-07-12
 */
@RestController
@RequestMapping("/dgtxPlaces")
public class DgtxPlacesController {

    @Autowired
    private DgtxPlacesServiceImpl dgtxPlacesService;

    /**
     * 获取所有一级分类
     * @return
     */
    @GetMapping("/linkage")
    public List<DgtxPlaces> linkage(){
        return dgtxPlacesService.getParent();
    }

    /**
     * 获取对应二级分类信息
     * @param parentId
     * @return
     */
    @GetMapping("/getSecondaryList")
    public List<DgtxPlaces> getSecondaryList(Integer parentId) {
        return dgtxPlacesService.getSecondaryList(parentId);
    }


}
